﻿<!doctype html>
<html>
<head>
    <title>微街秀 > 支付宝设置</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" type="text/css" href="css/css.css" />
    <link href="css/Makezfbset.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/ajax-data.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
</head>
<body>
    <div>
    <input type="hidden" id="refID" value="0" />
        <div class="wamtop">
            <div class="topleft back" onclick="window.location.href='Makesh_3.html'">             
                    <img src="img/5.jpg" />
            </div>
            <div class="topcententxt">支付宝设置</div>
        </div>
        <div class="nickname">
            <input type="text" class="nicknametext" id="ali_truename" placeholder="设置支付宝收款人姓名"/>
        </div>
        <div class="nickname">
            <input type="text" class="nicknametext" id="nicknametext" placeholder="设置支付宝账号"/>
        </div>
        <div class="nicksave">
            <div style="font-size: 16px;  color: White;">确定</div>
        </div>
    </div>
    <script>
        $(document).ready(function () {
            $(".back").bind("click", Back);
            load();
            bindclick();
        });

        function load() {
            if (!islogin()) { window.location.href = 'login.html'; return; }
            AjaxStart("ajax/fc_setting.ashx?get", "", function (data) {
                loadhtml(data.item);
            });
        }
        function loadhtml(item) {
            $("#ali_truename").val(item["ali_truename"]);
            $("#nicknametext").val(item["ali_name"]);
        }

        function bindclick() {
            $(".nicksave").click(function () {
                if (!islogin()) { window.location.href = 'login.html'; return; }
                if ($("#ali_truename").val() == "") {
                    Alert("请输入支付宝收款人姓名");
                    return;
                }
                if ($("#nicknametext").val() == "") {
                    Alert("请输入支付宝账号");
                    return;
                }
                AjaxStart("ajax/fc_setting.ashx?setting", "&ali_name=" + $("#nicknametext").val() + "&ali_truename=" + $("#ali_truename").val(), function (data) {
                    if (data.code == "0")
                        Back();
                    else
                        Alert(data.msg);
                });
            });
        }
        function Back() {
            if (getQueryString("url") != '')
                window.location.href = getQueryString("url");
            else
                window.location.href = "Makesh_3.html";
        }
    </script>
</body>
</html>
